home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / RIncludes / ConditionalMacros.r < prev    next >
Encoding:
Text File  |  1998-08-17  |  6.5 KB  |  184 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ConditionalMacros.r
  3.  
  4.      Contains:    Set up for compiler independent conditionals
  5.  
  6.      Version:    Technology:    Universal Interface Files 3.2
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1993-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17.  
  18. #ifndef __CONDITIONALMACROS_R__
  19. #define __CONDITIONALMACROS_R__
  20.  
  21. /****************************************************************************************************
  22.     UNIVERSAL_INTERFACES_VERSION
  23.     
  24.         0x0320 => version 3.2
  25.         0x0310 => version 3.1
  26.         0x0301 => version 3.0.1
  27.         0x0300 => version 3.0
  28.         0x0210 => version 2.1
  29.         This conditional did not exist prior to version 2.1
  30. ****************************************************************************************************/
  31. #define UNIVERSAL_INTERFACES_VERSION 0x0320
  32.  
  33. /****************************************************************************************************
  34.  
  35.     TARGET_CPU_≈    
  36.     These conditionals specify which microprocessor instruction set is being
  37.     generated.  At most one of these is true, the rest are false.
  38.  
  39.         TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  40.         TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  41.         TARGET_CPU_X86            - Compiler is generating x86 instructions
  42.         TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  43.         TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  44.         TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  45.  
  46.  
  47.     TARGET_OS_≈    
  48.     These conditionals specify in which Operating System the generated code will
  49.     run. At most one of the these is true, the rest are false.
  50.  
  51.         TARGET_OS_MAC            - Generate code will run under Mac OS
  52.         TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  53.         TARGET_OS_UNIX            - Generate code will run under some unix 
  54.  
  55.  
  56.     TARGET_RT_≈    
  57.     These conditionals specify in which runtime the generated code will
  58.     run. This is needed when the OS and CPU support more than one runtime
  59.     (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  60.  
  61.         TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  62.         TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  63.         TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used    
  64.         TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  65.  
  66.  
  67.     PRAGMA_≈
  68.     These conditionals specify whether the compiler supports particular #pragma's
  69.     
  70.         PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  71.         PRAGMA_ONCE              - Compiler supports: #pragma once
  72.         PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  73.         PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  74.         PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  75.         PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  76.         PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  77.         PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  78.  
  79.     FOUR_CHAR_CODE
  80.     This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  81.     is compiled down to the correct value on all compilers.
  82.  
  83.         FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  84.  
  85.     TYPE_≈
  86.     These conditionals specify whether the compiler supports particular types.
  87.  
  88.         TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  89.         TYPE_BOOL                - Compiler supports "bool"
  90.         TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  91.  
  92. ****************************************************************************************************/
  93.  
  94.  
  95.  
  96. #if defined(Environ_OS_Win32) || defined(Environ_OS_Unix) || defined(Environ_OS_Mac)
  97.  
  98.     #if Environ_OS_Win32
  99.         /*
  100.             Rez.exe resource compiler for Win32 from QuickTime 3.0, Apple Computer, Inc.    
  101.         */
  102.         #define TARGET_OS_MAC                0
  103.         #define TARGET_OS_WIN32                1
  104.         #define TARGET_OS_UNIX                0
  105.         #define TARGET_RT_LITTLE_ENDIAN        1
  106.         #define TARGET_RT_BIG_ENDIAN        0
  107.  
  108.     
  109.     #elif Environ_OS_Unix
  110.         /*
  111.             Rez resource compiler for unix from QuickTime 3.0, Apple Computer, Inc.    
  112.         */
  113.         #define TARGET_OS_MAC                0
  114.         #define TARGET_OS_WIN32                0
  115.         #define TARGET_OS_UNIX                1
  116.         #define TARGET_RT_LITTLE_ENDIAN        0
  117.         #define TARGET_RT_BIG_ENDIAN        1
  118.  
  119.     
  120.     #else
  121.         /*
  122.             Rez resource compiler for MacOS from QuickTime 3.0, Apple Computer, Inc.    
  123.         */
  124.         #define TARGET_OS_MAC                1
  125.         #define TARGET_OS_WIN32                0
  126.         #define TARGET_OS_UNIX                0
  127.         #define TARGET_RT_LITTLE_ENDIAN        0
  128.         #define TARGET_RT_BIG_ENDIAN        1
  129.     #endif
  130.  
  131.     
  132. #else
  133.     /*
  134.         Rez resource compiler for MacOS, Apple Computer, Inc.    
  135.     */
  136.     #define TARGET_OS_MAC                1
  137.     #define TARGET_OS_WIN32                0
  138.     #define TARGET_OS_UNIX                0
  139.     #define TARGET_RT_LITTLE_ENDIAN        0
  140.     #define TARGET_RT_BIG_ENDIAN        1
  141. #endif
  142.  
  143.  
  144.  
  145.  
  146. /****************************************************************************************************
  147.  
  148.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  149.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  150.                               are now more sensitive to change because CFM binds by name.  In the 
  151.                               past, system routine names were compiled out to just an A-Trap.  
  152.                               Macros have been added that each map an old name to its new name.  
  153.                               This allows old routine names to be used in existing source files,
  154.                               but the macros only work if OLDROUTINENAMES is true.  This support
  155.                               will be removed in the near future.  Thus, all source code should 
  156.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  157.                               to see if your code has any old names left in it.
  158.     
  159.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  160.                               has been moved from Strings to TextUtils.  It is conditionalized in
  161.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  162.                               This allows developers to upgrade to newer interface files without 
  163.                               having to change the includes in their source code.  But, it allows
  164.                               the slow migration of system calls to more understandable file locations.  
  165.                               OLDROUTINELOCATIONS currently defaults to true, but eventually will 
  166.                               default to false.
  167.  
  168. ****************************************************************************************************/
  169. #ifndef OLDROUTINENAMES
  170. #define OLDROUTINENAMES 0
  171. #endif
  172. #ifndef OLDROUTINELOCATIONS
  173. #define OLDROUTINELOCATIONS 0
  174. #endif
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182. #endif /* __CONDITIONALMACROS_R__ */
  183.  
  184.